//
//  TableController.m
//  MoneyIndividual
//
//  Created by Le Anh Tai on 12/26/13.
//  Copyright (c) 2013 Le Anh Tai. All rights reserved.
//

#import "TableController.h"
#import "MenuMediator.h"
#import "BadgeButton.h"
#import "NotificationsController.h"

@interface TableController ()

@end

@implementation TableController

- (id)init
{
    self = [super init];
    
    if (self)
    {
        [self initializeTableView];
    }
    
    return self;
}

- (id)initAsRootOfNavigationController
{
    self = [super initAsRootOfNavigationController];
    
    if (self)
    {
        [self initializeTableView];
    }
    
    return self;
}

- (id)initAsSubController
{
    self = [super initAsSubController];
    
    if (self)
    {
        [self initializeTableView];
    }
    
    return self;
}

- (void)initializeTableView
{
    _tableView = [[UITableView alloc] init];
    _tableView.dataSource = self;
    _tableView.delegate = self;
    _tableView.backgroundView = nil;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tableView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:_tableView];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    self.view.backgroundColor = COLOR_WHITE_PURE;
}

- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];
    
    _tableView.frame = RECT(0, 0, self.view.width, self.view.height - _bottomToolbar.height);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Delegate UITableView

- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
    return 0;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return HEI_CELL_DEFAULT;
}

- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
    return [[UITableViewCell alloc] init];
}

@end
